package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2019/1/5 15:25
 * @description
 */
public class Code287 {
    public int findDuplicate(int[] nums) {
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums.length; j++) {
                if (i == j) {
                    continue;
                }
                if (nums[i] == nums[j]) { return nums[i]; }
            }
        }
        return -1;
    }
}
